import request from '@/utils/request'

/**
 * 获取所有可使用的部门
 */
export function getAllDepartments() {
  return request({
    url: '/department/getAll',
    method: 'get'
  })
}

export function getEmpInSameDepart(id) {
  return request({
    url: `/employee/getSameList/${id}`,
    method: 'get'
  })
}
/**
 * 获取所有员工信息
 */
export function getAllEmployee() {
  return request({
    url: '/employee/getAll',
    method: 'get'
  })
}

export function getNewEmp() {
  return request({
    url: `/employee/getNewPersonList`,
    method: 'get'
  })
}
/**
 * 获取当前部门所有可用职位
 *
 */
export function getNewEmpPost(id) {
  return request({
    url: `/post/getPostWithDepartmentId/${id}`,
    method: 'get'
  })
}

export function createDepartment(department) {
  return request({
    url: `/department/add`,
    method: 'post',
    data: department
  })
}

export function deleteDepartment(id) {
  return request({
    url: `/department/delete/${id}`,
    method: 'delete'
  })
}

export function getNotLeaderList() {
  return request({
    url: `/employee/getNotLeaderList`,
    method: 'get'
  })
}

export function addNewEmp(employee) {
  return request({
    url: `/employee/update`,
    method: 'put',
    data: employee
  })
}

